﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Windows.Input;

namespace LayoutHelpers.BaseTypes
{
  public abstract class TypedConditionalLayoutRuleBase<TEvaluator, TCommand> : ConditionalLayoutRule<TEvaluator> 
    where TCommand : class, ICommand, new()
    where TEvaluator : ILayoutEvaluator, new()
  {
    public TCommand TypedTrueCommand { get; protected set; }
    public TCommand TypedFalseCommand { get; protected set; }

    public override ICommand FalseCommand
    {
      get
      {
        return TypedFalseCommand;
      }
      set
      {
        throw new NotSupportedException("must set typed versions");
      }
    }

    public override ICommand TrueCommand
    {
      get
      {
        return TypedTrueCommand;
      }
      set
      {
        throw new NotSupportedException("must set typed versions");
      }
    }

    public TypedConditionalLayoutRuleBase()
    {
      TypedTrueCommand = new TCommand();
    }
  }
}
